﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DinnerParty
{
    public partial class Form1 : Form
    {
        Dinner Dinnerparty;
        public Form1()
        {
            InitializeComponent();
            Dinnerparty = new Dinner() { numberOfPeople = 5 };
             
             Dinnerparty.calculateCostOfDecoration(fancyCheckBox.Checked);
             Dinnerparty.setHealthyOption(healthyCheckBox.Checked);
             displayDinnerPartyCost();
        }
        private void displayDinnerPartyCost()
        {
            decimal cost = Dinnerparty.calculateCost(healthyCheckBox.Checked);
            tbCost.Text = cost.ToString("c");
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            Dinnerparty.numberOfPeople = (int)numericUpDown1.Value;
            displayDinnerPartyCost();
        }

        private void fancyCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            Dinnerparty.calculateCostOfDecoration(fancyCheckBox.Checked);
            displayDinnerPartyCost();
        }

        private void healthyCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            Dinnerparty.setHealthyOption(healthyCheckBox.Checked);
            displayDinnerPartyCost();
        }

    }
}
